package com.nuc.kl.module.kpoint.action;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.nuc.kl.base.BaseAction;
import com.nuc.kl.module.kpoint.entity.KnowledgeLog;
import com.nuc.kl.module.kpoint.service.KnowledgeLogService;

@Controller
@Scope("prototype")
public class KnowledgeLogAction extends BaseAction<KnowledgeLog>{
	
	
	/**  测试 */
	public String test() throws Exception {
		
		return "test";
	}

	/** 列表 */
	public String list() throws Exception {
		models = knowledgeLogService.findAll();
		return "list";
	}

	/** 删除 */
	public String delete() throws Exception {
		
		knowledgeLogService.delete(model.getId());
		return "toList";
	}

	/** 添加页面 */
	public String addUI() throws Exception {
		
		return "saveUI";
	}

	/** 添加 */
	public String add() throws Exception {
		knowledgeLogService.save(model);
		return "toList";
	}

	/** 修改页面 */
	public String editUI() throws Exception {
		model = knowledgeLogService.getById(model.getId());
		
		return "saveUI";
	}

	/** 修改 */
	public String edit() throws Exception {
		
		knowledgeLogService.update(model);
		return "toList";
	}

	


	

//	-----------------getter-----------setter---------------------------

	
}
